/**
 * 
 */
package com.csair.youth.dao.query.impl;

import java.util.Map;

import com.csair.youth.database.Employee;
import com.csair.youth.database.Permission;
import common.query.Query;
import common.query.QueryUtils;

/**
 * @author mickey
 *
 */
public class PermissionQueryDaoImpl extends BaseQueryDao {

	/* (non-Javadoc)
	 * @see com.csair.youth.dao.query.impl.BaseQueryDao#createQuery(java.util.Map)
	 */
	@Override
	protected Query createQuery(Map map) {
		// TODO Auto-generated method stub
		StringBuffer buf = new StringBuffer();
		buf.append(" from " + Permission.class.getName() + " a ");
		buf.append(" where 1=1 ");
		buf.append("  /~ and a." + Permission.PROP_NAME + " like {name?string_fl} ~/");
		buf.append("  /~ and a." + Permission.PROP_URL + " like {url?string_fl} ~/");
		Query query = QueryUtils.filterQuery(buf.toString(), map);
		return query;
	}

	/* (non-Javadoc)
	 * @see com.csair.youth.dao.query.impl.BaseQueryDao#createSelect(java.lang.String)
	 */
	@Override
	protected String createSelect(String temp) {
		// TODO Auto-generated method stub
		return "select a " +temp;
	}

}
